home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / tcoop10a.zip / DOC.ZIP / ICON.DOC < prev    next >
Text File  |  1991-11-20  |  6KB  |  132 lines

  1. ICON.DOC        11/15/91        Copyright (c) 1991 by James S. Clark
  2. ==========================================================================
  3. ICON
  4. Icon Class
  5. --------------------------------------------------------------------------
  6. Class Name                      Icon
  7. Superclass                      <none>
  8. Category                        Graphics
  9. Other classes referenced        <none>
  10. Other catagories referenced     <none>
  11. Used by                         <none>
  12. Inherited by                    <none>
  13.  
  14. Declaration                     Icon    *icon = new Icon(max, wide, high);
  15.  
  16. Instance Variables
  17.                                 char    *icon[256];
  18.                                 int     iconmax;
  19.                                 int     iconwide;
  20.                                 int     iconhigh;
  21. Instance Methods
  22.                                 Icon    (int max = 256, int wide = 16,
  23.                                                         int high = 16);
  24.                                 ~Icon   ();
  25.                                 void    draw    (int num, int x, int y);
  26.                                 void    drawmasked(int num, int x, int y,
  27.                                                                 int mask);
  28.                                 void    get     (int num, int x, int y);
  29.                                 void    getmask   (int num, int x, int y,
  30.                                                                 int color);
  31.                                 void    put     (int num, int x, int y);
  32.                                 void    putmasked (int num, int x, int y,
  33.                                                                 int mask);
  34.                                 void    read    (int num, char *filename);
  35.                                 void    reads   (int num, char *filename);
  36.                                 void    scan    (int num, int x, int y);
  37.                                 void    write   (int num, char *filename);
  38.                                 void    writes  (int num, char *filename);
  39. --------------------------------------------------------------------------
  40. GENERAL DESCRIPTION
  41.  
  42. The Icon Class is used to manipulate large libraries of small images using
  43. the BGI driver.  It allows you to create and draw standard and masked
  44. icons, as well as load and save icons to the disk drive one at a time,
  45. or in large groups.  The maximum number of Icons in a group is 256.
  46.  
  47. NOTE: The BGI graphics driver MUST be initiazed before actually drawing
  48. any icons.  The Icon Class does NOT require the use of the Graphic Class,
  49. but does require that you initialize the display screen before using
  50. the put() method.
  51.  
  52. --------------------------------------------------------------------------
  53. VARIABLES
  54.  
  55. char    *icon[256];
  56.         The array of pointers to the icons in the array.  Generally you
  57.         will not access this directly, but it is provided so that you
  58.         can if you need to.  The maximum is 256 icons.
  59.  
  60. int     iconmax;
  61.         The number of icons held in the current icon array.
  62.  
  63. int     iconwide;
  64.         The width in pixels of the current icon array.
  65.  
  66. int     iconhigh;
  67.         The height in pixels of the current icon.
  68.  
  69. --------------------------------------------------------------------------
  70. METHODS
  71.  
  72. Icon    (int max = 256, int wide = 16, int high = 16);
  73.         Creates a new instance of the Icon Class and initializes the
  74.         icon array.  If no parameters are given, the default is 256 icons
  75.         16 pixels wide and 16 pixels high.
  76.  
  77. ~Icon   ();
  78.         Deallocates the memory for the icon array.  This is called last
  79.         to make sure that things are cleaned-up nicely.
  80.  
  81. void    draw    (int num, int x, int y);
  82.         Place the numbered icon on the screen at position x, y.
  83.  
  84. void    drawmasked(int num, int x, int y, int mask);
  85.         This method will draw an icon and it's matching mask on the
  86.         screen at x, y.  Both the icon number and the mask number must
  87.         be specified.
  88.  
  89. void    get     (int num, int x, int y);
  90.         Get an icon image from the screen at scaled position x,y and
  91.         place it into the icon array at the numbered position.
  92.  
  93. void    getmask   (int num, int x, int y, int backcolor);
  94.         Creates an icon mask by converting the background color pixels of
  95.         the image at the scaled position x,y to white and saving the result
  96.         in the numbered position of the icon array.  This method reads the
  97.         display screen to create the mask.  It will draw over any existing
  98.         data in the screen, and then read the resulting mask.
  99.  
  100. void    put     (int num, int x, int y);
  101.         Place the numbered icon on the screen at the scaled position x, y.
  102.  
  103. void    putmasked (int num, int x, int y, int mask);
  104.         This method will place an icon and it's matching mask on the
  105.         screen at the scaled postion x, y.  Both the icon number and the
  106.         mask number must be specified.
  107.  
  108. void    read    (int num, char *filename);
  109.         Reads a number of icons from the disk, starting at the beginning
  110.         of the file, and places them into the icon array.
  111.  
  112. void    reads   (int num, char *filename);
  113.         Reads a single icon from the disk and places it into the icon
  114.         array in the numbered position.
  115.  
  116. void    scan    (int num, int x, int x);
  117.         The method does the same thing as get(), but uses absolute screen
  118.         coordinates, not scaled.
  119.  
  120. void    write   (int num, char *filename);
  121.         Writes a number of icons to the disk, starting at the begging of
  122.         the array, and places them in a file.
  123.  
  124. void    writes  (int num, char *filename);
  125.         Writes a single icon to the disk and places it into the same
  126.         relative position as in the icon array.
  127.  
  128. --------------------------------------------------------------------------
  129. ICON.DOC                           Copyright (c) 1991 by James S. Clark
  130. ==========================================================================
  131.  
  132.